<?php
/* @var $this ContentController */
/* @var $model Node */
/* @var $channel Channel */
/* @var $form TbActiveForm */
?>

<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id' => get_class($model) . '-form',
	'enableClientValidation' => true,
	'clientOptions' => array(
		'validateOnSubmit' => true,
	),
)); ?>

<p class="help-block"><span class="required">*</span> 字段必填.</p>

<?php echo $form->errorSummary($model); ?>

<div class="row-fluid">
	<div class="span8">
		<div id="form-main">
			<?php echo $form->textFieldRow($model, 'title', array('class' => 'input-block-level', 'maxlength' => 128)); ?>

			<?php $form->widget('YCKEditor', array(
				'model' => $model,
				'attribute' => 'content',
			)); ?>
			<?php //echo $form->textAreaRow($model, 'excerpt', array('class' => 'input-block-level', 'rows' => 6)); ?>
		</div>
	</div>
	<div class="span4">
		<div id="form-side">
			<?php
			if (isset($model->YFileUsageBehavior)):
				$this->widget('YUploadWidget', array(
					'model' => $model,
					'attribute' => 'image',
					'form' => $form,
				));
			endif;
			?>

			<?php
			if (isset($model->YTaxonomyBehavior)):
				$this->widget('YTaxonomyWidget', array(
					'model' => $model,
					'form' => $form,
				));
			endif;
			?>

			<?php echo $form->dropDownListRow($model, 'status', $model->getStatusList()); ?>

			<?php echo $form->checkBoxRow($model, 'sticky'); ?>

			<?php echo $form->checkBoxRow($model, 'promote'); ?>

			<?php
			$this->widget('YDateTimePicker', array(
				'model' => $model,
				'form' => $form,
				'options' => array(
					'showAnim' => 'fold',
					'dateFormat' => 'yy-mm-dd',
				),
				'attribute' => 'publish_datetime',
			));
			?>
		</div>
	</div>
</div>

<div class="form-actions">
	<?php $this->widget('YFormActions', array('model' => $model, 'channel' => $channel)); ?>
</div>
<?php $this->endWidget(); ?>
